function [spectrum, frequency] = fourierTransform(signal, time)
    spectrum = fftshift(fft(signal, [], 2), 2);
    if nargout > 1
        num = numel(time);
        fs = (num - 1) / (time(end) - time(1));
        frequency = (0:num-1)/num * fs - fs / 2;
    end % if
end % function
